<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibTools: H:/project/LibTools/src/socket/TcpIoServer.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibTools
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.16 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','搜索');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_9ad1227260954e346101f3844f0abb3d.html">socket</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">TcpIoServer.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_tcp_io_server_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef __TCPIOSERVEREX_H__</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define __TCPIOSERVEREX_H__</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_tcp_server_8h.html">./internal/TcpServer.h</a>&quot;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160; </div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<a class="code" href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="keyword">class </span><a class="code" href="class_c_tcp_io_socket.html">CTcpIoSocket</a>;</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160; </div>
<div class="line"><a name="l00011"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html">   11</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_c_tcp_io_server.html">CTcpIoServer</a></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;{</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;    <a class="code" href="class_c_tcp_io_server.html#afcb6a119f5c281a29caba2bdc3550a9c">delete_class_copy_operator</a>(<a class="code" href="class_c_tcp_io_server.html">CTcpIoServer</a>);</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html#a235b3dd749f09084c3065c1def0ceda8">   19</a></span>&#160;    <a class="code" href="class_c_tcp_io_server.html#a235b3dd749f09084c3065c1def0ceda8">CTcpIoServer</a>(<span class="keywordtype">bool</span> isWriteLog = <span class="keyword">false</span>){</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;         <a class="code" href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">_service</a>.<a class="code" href="class_shared_ptr.html#a0b0a4c8396bf40f91994f729855c0a5a">Reset</a>(<span class="keyword">new</span> <a class="code" href="class_c_tcp_server.html">CTcpServer</a>(isWriteLog));</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    }</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; </div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html#a5c621e5b8b881659a103010542a480e3">   24</a></span>&#160;    <a class="code" href="class_c_tcp_io_server.html#a5c621e5b8b881659a103010542a480e3">~CTcpIoServer</a>() {}</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160; </div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html#aef555ccb9b2f3323c317aea533969442">   33</a></span>&#160;    <a class="code" href="class_c_sock_error.html">CSockError</a> <a class="code" href="class_c_tcp_io_server.html#aef555ccb9b2f3323c317aea533969442">Init</a>(<a class="code" href="class_c_tcp_io_socket.html">CTcpIoSocket</a>&amp; sock, <span class="keywordtype">bool</span> isServer = <span class="keyword">false</span>) {</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">_service</a>-&gt;<a class="code" href="class_c_tcp_server.html#a91a5d49009e5996ab2193e53339f4c61">Init</a>(*(<a class="code" href="class_c_socket.html">CSocket</a>*)(&amp;sock), isServer);</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    }</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160; </div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> Func&gt;</div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html#a6fb652948c48295b25b72617abf38c0b">   46</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_tcp_io_server.html#a6fb652948c48295b25b72617abf38c0b">AsyncAccept</a>(<a class="code" href="class_c_tcp_io_socket.html">CTcpIoSocket</a>&amp; svrSock, <a class="code" href="class_c_tcp_io_socket.html">CTcpIoSocket</a>&amp; cliSock, <span class="keyword">const</span> Func&amp; func) {</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        <a class="code" href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">_service</a>-&gt;<a class="code" href="class_c_tcp_server.html#a215a3edd8190f5ed24b788a547958d87">AsyncAccept</a>(*(<a class="code" href="class_c_socket.html">CSocket</a>*)(&amp;svrSock), *(<a class="code" href="class_c_socket.html">CSocket</a>*)(&amp;cliSock), <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>(<span class="keyword">new</span> AcceptHandleNull&lt;Func&gt;(func)));</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    }</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> Func&gt;</div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html#a63108bad232b26132e9c8759603d7db4">   50</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_tcp_io_server.html#a63108bad232b26132e9c8759603d7db4">AsyncAccept</a>(<a class="code" href="class_c_tcp_io_socket.html">CTcpIoSocket</a>&amp; svrSock, <a class="code" href="class_c_tcp_io_socket.html">CTcpIoSocket</a>&amp; cliSock, <span class="keyword">const</span> Func&amp; func, <span class="keywordtype">void</span>* invoker){</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        <a class="code" href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">_service</a>-&gt;<a class="code" href="class_c_tcp_server.html#a215a3edd8190f5ed24b788a547958d87">AsyncAccept</a>(*(<a class="code" href="class_c_socket.html">CSocket</a>*)(&amp;svrSock), *(<a class="code" href="class_c_socket.html">CSocket</a>*)(&amp;cliSock), <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>(<span class="keyword">new</span> AcceptHandle&lt;Func&gt;(func)), invoker);</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    }</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> Func&gt;</div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html#a2bdfa5d49968abaa4018c5d39955a62e">   64</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_tcp_io_server.html#a2bdfa5d49968abaa4018c5d39955a62e">AsyncRead</a>(<a class="code" href="class_c_tcp_io_socket.html">CTcpIoSocket</a>&amp; sock, <span class="keyword">const</span> <a class="code" href="class_c_stream_iteator.html">CStreamIteator</a>&amp; buff, Func func) {</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;         <a class="code" href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">_service</a>-&gt;<a class="code" href="class_c_tcp_server.html#a0783f660e11a3da11d15461f5917a125">AsyncRead</a>(*(<a class="code" href="class_c_socket.html">CSocket</a>*)(&amp;sock), buff, <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>(<span class="keyword">new</span> ReadHandleNull&lt;Func&gt;(func)));</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    }</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> Func&gt;</div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html#a4ee80a54a511c4a688b9f125571086f2">   68</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_tcp_io_server.html#a4ee80a54a511c4a688b9f125571086f2">AsyncRead</a>(<a class="code" href="class_c_tcp_io_socket.html">CTcpIoSocket</a>&amp; sock, <span class="keyword">const</span> <a class="code" href="class_c_stream_iteator.html">CStreamIteator</a>&amp; buff, Func func, <span class="keywordtype">void</span>* invoker) {</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;        <a class="code" href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">_service</a>-&gt;<a class="code" href="class_c_tcp_server.html#a0783f660e11a3da11d15461f5917a125">AsyncRead</a>(*(<a class="code" href="class_c_socket.html">CSocket</a>*)(&amp;sock), buff, <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>(<span class="keyword">new</span> ReadHandle&lt;Func&gt;(func)), invoker);</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    }</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> Func&gt;</div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html#a5c551ad1e1a62d0527bdbfa37dbdc73b">   82</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_tcp_io_server.html#a5c551ad1e1a62d0527bdbfa37dbdc73b">AsyncSend</a>(<a class="code" href="class_c_tcp_io_socket.html">CTcpIoSocket</a>&amp; sock, <span class="keyword">const</span> <a class="code" href="class_c_stream_iteator.html">CStreamIteator</a>&amp; buff, <span class="keyword">const</span> Func&amp; func) {</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;         <a class="code" href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">_service</a>-&gt;<a class="code" href="class_c_tcp_server.html#a253d11319caeab1b90d4b2514671d963">AsyncSend</a>(*(<a class="code" href="class_c_socket.html">CSocket</a>*)(&amp;sock), buff, <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>(<span class="keyword">new</span> WriteHandleNull&lt;Func&gt;(func)));</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    }</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> Func&gt;</div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html#a3d57fa6836c9b6a1bbb87f48234e0dba">   86</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_tcp_io_server.html#a3d57fa6836c9b6a1bbb87f48234e0dba">AsyncSend</a>(<a class="code" href="class_c_tcp_io_socket.html">CTcpIoSocket</a>&amp; sock, <span class="keyword">const</span> <a class="code" href="class_c_stream_iteator.html">CStreamIteator</a>&amp; buff, <span class="keyword">const</span> Func&amp; func, <span class="keywordtype">void</span>* invoker) {</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <a class="code" href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">_service</a>-&gt;<a class="code" href="class_c_tcp_server.html#a253d11319caeab1b90d4b2514671d963">AsyncSend</a>(*(<a class="code" href="class_c_socket.html">CSocket</a>*)(&amp;sock), buff, <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>(<span class="keyword">new</span> WriteHandle&lt;Func&gt;(func)), invoker);</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    }</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> Func&gt;</div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html#ae9c8a68befcda8eebb21c5d655eb439f">   98</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_tcp_io_server.html#ae9c8a68befcda8eebb21c5d655eb439f">Post</a>(<span class="keyword">const</span> Func&amp; func) {</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;        <a class="code" href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">_service</a>-&gt;<a class="code" href="class_c_tcp_server.html#a7aec7b948d696161ec212911cf9d09a8">Post</a>(<a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>(<span class="keyword">new</span> <a class="code" href="class_post_handle_null.html">PostHandleNull&lt;Func&gt;</a>(func)));</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    }</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">class</span> Func&gt;</div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html#a1d079536f01361ca5731dbb56636047a">  102</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_tcp_io_server.html#a1d079536f01361ca5731dbb56636047a">Post</a>(<span class="keyword">const</span> Func&amp; func, <span class="keywordtype">void</span>* invoker) {</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        <a class="code" href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">_service</a>-&gt;<a class="code" href="class_c_tcp_server.html#a7aec7b948d696161ec212911cf9d09a8">Post</a>(<a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>(<span class="keyword">new</span> <a class="code" href="class_post_handle.html">PostHandle&lt;Func&gt;</a>(func)), invoker);</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    }</div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html#ad7d8f89bea7573233ee25d4802ae2ab1">  111</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_c_tcp_io_server.html#ad7d8f89bea7573233ee25d4802ae2ab1">Run</a>() {</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">_service</a>-&gt;<a class="code" href="class_c_tcp_server.html#af863728c772ad57a28eda8b73e5a7313">Run</a>();</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    }</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html#ab89e49a1bf4a21c54951e4ae63b456b0">  119</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_c_tcp_io_server.html#ab89e49a1bf4a21c54951e4ae63b456b0">Run_One</a>() {</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">_service</a>-&gt;<a class="code" href="class_c_tcp_server.html#af28974b451b2af615c6ba3882b2b35c7">Run_One</a>();</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    }</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160; </div>
<div class="line"><a name="l00124"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html#addea632498b2adb1a24972ffc6c25231">  124</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_tcp_io_server.html#addea632498b2adb1a24972ffc6c25231">NotifyStop</a>() {</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;        <a class="code" href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">_service</a>-&gt;<a class="code" href="class_c_tcp_server.html#ae943fc8a2eb1bc116a4bfa714ce88e53">NotifyStop</a>();</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    }</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160; </div>
<div class="line"><a name="l00132"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html#aad2df98fa7b30265cccde64871cc7747">  132</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_c_tcp_io_server.html#aad2df98fa7b30265cccde64871cc7747">IsStop</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">_service</a>-&gt;<a class="code" href="class_c_tcp_server.html#a34e5408e88e0161b6a08807266302ce9">IsStop</a>();</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    }</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160; </div>
<div class="line"><a name="l00137"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html#a754a0959529230be473651babd43e221">  137</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_tcp_io_server.html#a754a0959529230be473651babd43e221">WaitServerStop</a>() {</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;        <a class="code" href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">_service</a>-&gt;<a class="code" href="class_c_tcp_server.html#a5e63118cf3e1b653812c6a0b26db979a">WaitServerStop</a>();</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    }</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160; </div>
<div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html#ad0e29bdab15b44c4ea6c9a246424865f">  142</a></span>&#160;    <a class="code" href="class_c_basic_service.html">CBasicService</a>* <a class="code" href="class_c_tcp_io_server.html#ad0e29bdab15b44c4ea6c9a246424865f">GetTcpServicePtr</a>() {</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;        <span class="keywordflow">return</span> dynamic_cast&lt;CBasicService*&gt;(<a class="code" href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">_service</a>.<a class="code" href="class_shared_ptr.html#a0f15d2d3d2834b0667791f3abfd9e0d7">Get</a>());</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    }</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00146"></a><span class="lineno"><a class="line" href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">  146</a></span>&#160;    <a class="code" href="class_shared_ptr.html">SharedPtr&lt;CTcpServer&gt;</a> <a class="code" href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">_service</a>;</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;};</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160; </div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;<a class="code" href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160; </div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;<span class="preprocessor">#endif // __TCPIOSERVEREX_H__</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclass_c_tcp_server_html_a0783f660e11a3da11d15461f5917a125"><div class="ttname"><a href="class_c_tcp_server.html#a0783f660e11a3da11d15461f5917a125">CTcpServer::AsyncRead</a></div><div class="ttdeci">virtual void AsyncRead(CSocket &amp;sock, const CStreamIteator &amp;buff, const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker=NullPtr)</div><div class="ttdoc">投递一个接收请求</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_server_8cpp_source.html#l00059">TcpServer.cpp:59</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_aef555ccb9b2f3323c317aea533969442"><div class="ttname"><a href="class_c_tcp_io_server.html#aef555ccb9b2f3323c317aea533969442">CTcpIoServer::Init</a></div><div class="ttdeci">CSockError Init(CTcpIoSocket &amp;sock, bool isServer=false)</div><div class="ttdoc">初始化套接字与服务类设备进行绑定</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00033">TcpIoServer.h:33</a></div></div>
<div class="ttc" id="aclass_c_sock_error_html"><div class="ttname"><a href="class_c_sock_error.html">CSockError</a></div><div class="ttdoc">套接字错误信息类</div><div class="ttdef"><b>Definition:</b> <a href="_sock_error_8h_source.html#l00013">SockError.h:13</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_a754a0959529230be473651babd43e221"><div class="ttname"><a href="class_c_tcp_io_server.html#a754a0959529230be473651babd43e221">CTcpIoServer::WaitServerStop</a></div><div class="ttdeci">void WaitServerStop()</div><div class="ttdoc">通知服务停止并等待</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00137">TcpIoServer.h:137</a></div></div>
<div class="ttc" id="aclass_c_tcp_server_html_ae943fc8a2eb1bc116a4bfa714ce88e53"><div class="ttname"><a href="class_c_tcp_server.html#ae943fc8a2eb1bc116a4bfa714ce88e53">CTcpServer::NotifyStop</a></div><div class="ttdeci">virtual void NotifyStop()</div><div class="ttdoc">通知服务停止</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_server_8cpp_source.html#l00111">TcpServer.cpp:111</a></div></div>
<div class="ttc" id="aclass_c_tcp_server_html_af28974b451b2af615c6ba3882b2b35c7"><div class="ttname"><a href="class_c_tcp_server.html#af28974b451b2af615c6ba3882b2b35c7">CTcpServer::Run_One</a></div><div class="ttdeci">virtual bool Run_One()</div><div class="ttdoc">运行一次服务</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_server_8cpp_source.html#l00106">TcpServer.cpp:106</a></div></div>
<div class="ttc" id="aclass_c_stream_iteator_html"><div class="ttname"><a href="class_c_stream_iteator.html">CStreamIteator</a></div><div class="ttdef"><b>Definition:</b> <a href="_stream_byte_8h_source.html#l00011">StreamByte.h:11</a></div></div>
<div class="ttc" id="aclass_c_tcp_server_html"><div class="ttname"><a href="class_c_tcp_server.html">CTcpServer</a></div><div class="ttdef"><b>Definition:</b> <a href="_tcp_server_8h_source.html#l00019">TcpServer.h:19</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_a5c621e5b8b881659a103010542a480e3"><div class="ttname"><a href="class_c_tcp_io_server.html#a5c621e5b8b881659a103010542a480e3">CTcpIoServer::~CTcpIoServer</a></div><div class="ttdeci">~CTcpIoServer()</div><div class="ttdoc">销毁一个tcp io服务类</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00024">TcpIoServer.h:24</a></div></div>
<div class="ttc" id="aclass_shared_ptr_html"><div class="ttname"><a href="class_shared_ptr.html">SharedPtr&lt; HandleBase &gt;</a></div></div>
<div class="ttc" id="aclass_shared_ptr_html_a0f15d2d3d2834b0667791f3abfd9e0d7"><div class="ttname"><a href="class_shared_ptr.html#a0f15d2d3d2834b0667791f3abfd9e0d7">SharedPtr::Get</a></div><div class="ttdeci">Ty * Get()</div><div class="ttdef"><b>Definition:</b> <a href="_shared_ptr_8h_source.html#l00202">SharedPtr.h:202</a></div></div>
<div class="ttc" id="aclass_c_tcp_server_html_a91a5d49009e5996ab2193e53339f4c61"><div class="ttname"><a href="class_c_tcp_server.html#a91a5d49009e5996ab2193e53339f4c61">CTcpServer::Init</a></div><div class="ttdeci">virtual CSockError Init(CSocket &amp;sock, bool isServer=false)</div><div class="ttdoc">将sock与tcp绑定，一个socket只能绑定一个tcp服务类</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_server_8cpp_source.html#l00036">TcpServer.cpp:36</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_a4ee80a54a511c4a688b9f125571086f2"><div class="ttname"><a href="class_c_tcp_io_server.html#a4ee80a54a511c4a688b9f125571086f2">CTcpIoServer::AsyncRead</a></div><div class="ttdeci">void AsyncRead(CTcpIoSocket &amp;sock, const CStreamIteator &amp;buff, Func func, void *invoker)</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00068">TcpIoServer.h:68</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html"><div class="ttname"><a href="class_c_tcp_io_server.html">CTcpIoServer</a></div><div class="ttdoc">tcp io服务端服务类</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00011">TcpIoServer.h:11</a></div></div>
<div class="ttc" id="atools_8h_html_a201ce692c9dca6599e5c12d00167419b"><div class="ttname"><a href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div><div class="ttdeci">#define DEF_BEG_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00036">tools.h:36</a></div></div>
<div class="ttc" id="aclass_c_tcp_server_html_a253d11319caeab1b90d4b2514671d963"><div class="ttname"><a href="class_c_tcp_server.html#a253d11319caeab1b90d4b2514671d963">CTcpServer::AsyncSend</a></div><div class="ttdeci">virtual void AsyncSend(CSocket &amp;sock, const CStreamIteator &amp;buff, const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker=NullPtr)</div><div class="ttdoc">投递一个写请求</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_server_8cpp_source.html#l00073">TcpServer.cpp:73</a></div></div>
<div class="ttc" id="aclass_c_tcp_server_html_a215a3edd8190f5ed24b788a547958d87"><div class="ttname"><a href="class_c_tcp_server.html#a215a3edd8190f5ed24b788a547958d87">CTcpServer::AsyncAccept</a></div><div class="ttdeci">virtual void AsyncAccept(CSocket &amp;svrSock, CSocket &amp;cliSock, const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker=NullPtr)</div><div class="ttdoc">投递一个接收连接请求</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_server_8cpp_source.html#l00046">TcpServer.cpp:46</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_a235b3dd749f09084c3065c1def0ceda8"><div class="ttname"><a href="class_c_tcp_io_server.html#a235b3dd749f09084c3065c1def0ceda8">CTcpIoServer::CTcpIoServer</a></div><div class="ttdeci">CTcpIoServer(bool isWriteLog=false)</div><div class="ttdoc">构造一个tcp io服务类</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00019">TcpIoServer.h:19</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_afcb6a119f5c281a29caba2bdc3550a9c"><div class="ttname"><a href="class_c_tcp_io_server.html#afcb6a119f5c281a29caba2bdc3550a9c">CTcpIoServer::delete_class_copy_operator</a></div><div class="ttdeci">delete_class_copy_operator(CTcpIoServer)</div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_aad2df98fa7b30265cccde64871cc7747"><div class="ttname"><a href="class_c_tcp_io_server.html#aad2df98fa7b30265cccde64871cc7747">CTcpIoServer::IsStop</a></div><div class="ttdeci">bool IsStop() const</div><div class="ttdoc">服务是否停止</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00132">TcpIoServer.h:132</a></div></div>
<div class="ttc" id="aclass_c_socket_html"><div class="ttname"><a href="class_c_socket.html">CSocket</a></div><div class="ttdoc">套接口类</div><div class="ttdef"><b>Definition:</b> <a href="_socket_8h_source.html#l00030">Socket.h:30</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_ad7d8f89bea7573233ee25d4802ae2ab1"><div class="ttname"><a href="class_c_tcp_io_server.html#ad7d8f89bea7573233ee25d4802ae2ab1">CTcpIoServer::Run</a></div><div class="ttdeci">bool Run()</div><div class="ttdoc">运行服务</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00111">TcpIoServer.h:111</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_a5c551ad1e1a62d0527bdbfa37dbdc73b"><div class="ttname"><a href="class_c_tcp_io_server.html#a5c551ad1e1a62d0527bdbfa37dbdc73b">CTcpIoServer::AsyncSend</a></div><div class="ttdeci">void AsyncSend(CTcpIoSocket &amp;sock, const CStreamIteator &amp;buff, const Func &amp;func)</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00082">TcpIoServer.h:82</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_ae9c8a68befcda8eebb21c5d655eb439f"><div class="ttname"><a href="class_c_tcp_io_server.html#ae9c8a68befcda8eebb21c5d655eb439f">CTcpIoServer::Post</a></div><div class="ttdeci">void Post(const Func &amp;func)</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00098">TcpIoServer.h:98</a></div></div>
<div class="ttc" id="atools_8h_html_ac909db71799bb22cb7d636a34cd785e4"><div class="ttname"><a href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div><div class="ttdeci">#define DEF_END_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00038">tools.h:38</a></div></div>
<div class="ttc" id="aclass_post_handle_html"><div class="ttname"><a href="class_post_handle.html">PostHandle</a></div><div class="ttdoc">用户投递回调</div><div class="ttdef"><b>Definition:</b> <a href="_sock_tools_8h_source.html#l00242">SockTools.h:242</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_a63108bad232b26132e9c8759603d7db4"><div class="ttname"><a href="class_c_tcp_io_server.html#a63108bad232b26132e9c8759603d7db4">CTcpIoServer::AsyncAccept</a></div><div class="ttdeci">void AsyncAccept(CTcpIoSocket &amp;svrSock, CTcpIoSocket &amp;cliSock, const Func &amp;func, void *invoker)</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00050">TcpIoServer.h:50</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_ab89e49a1bf4a21c54951e4ae63b456b0"><div class="ttname"><a href="class_c_tcp_io_server.html#ab89e49a1bf4a21c54951e4ae63b456b0">CTcpIoServer::Run_One</a></div><div class="ttdeci">bool Run_One()</div><div class="ttdoc">运行一次服务</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00119">TcpIoServer.h:119</a></div></div>
<div class="ttc" id="aclass_shared_ptr_html_a0b0a4c8396bf40f91994f729855c0a5a"><div class="ttname"><a href="class_shared_ptr.html#a0b0a4c8396bf40f91994f729855c0a5a">SharedPtr::Reset</a></div><div class="ttdeci">void Reset(Ty *p)</div><div class="ttdef"><b>Definition:</b> <a href="_shared_ptr_8h_source.html#l00175">SharedPtr.h:175</a></div></div>
<div class="ttc" id="aclass_c_tcp_server_html_af863728c772ad57a28eda8b73e5a7313"><div class="ttname"><a href="class_c_tcp_server.html#af863728c772ad57a28eda8b73e5a7313">CTcpServer::Run</a></div><div class="ttdeci">virtual bool Run()</div><div class="ttdoc">运行服务</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_server_8cpp_source.html#l00101">TcpServer.cpp:101</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_a2bdfa5d49968abaa4018c5d39955a62e"><div class="ttname"><a href="class_c_tcp_io_server.html#a2bdfa5d49968abaa4018c5d39955a62e">CTcpIoServer::AsyncRead</a></div><div class="ttdeci">void AsyncRead(CTcpIoSocket &amp;sock, const CStreamIteator &amp;buff, Func func)</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00064">TcpIoServer.h:64</a></div></div>
<div class="ttc" id="aclass_c_tcp_server_html_a7aec7b948d696161ec212911cf9d09a8"><div class="ttname"><a href="class_c_tcp_server.html#a7aec7b948d696161ec212911cf9d09a8">CTcpServer::Post</a></div><div class="ttdeci">virtual void Post(const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker=NullPtr)</div><div class="ttdoc">投递一个中断请求</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_server_8cpp_source.html#l00087">TcpServer.cpp:87</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_a6fb652948c48295b25b72617abf38c0b"><div class="ttname"><a href="class_c_tcp_io_server.html#a6fb652948c48295b25b72617abf38c0b">CTcpIoServer::AsyncAccept</a></div><div class="ttdeci">void AsyncAccept(CTcpIoSocket &amp;svrSock, CTcpIoSocket &amp;cliSock, const Func &amp;func)</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00046">TcpIoServer.h:46</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_a1d079536f01361ca5731dbb56636047a"><div class="ttname"><a href="class_c_tcp_io_server.html#a1d079536f01361ca5731dbb56636047a">CTcpIoServer::Post</a></div><div class="ttdeci">void Post(const Func &amp;func, void *invoker)</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00102">TcpIoServer.h:102</a></div></div>
<div class="ttc" id="a_tcp_server_8h_html"><div class="ttname"><a href="_tcp_server_8h.html">TcpServer.h</a></div></div>
<div class="ttc" id="aclass_c_tcp_server_html_a5e63118cf3e1b653812c6a0b26db979a"><div class="ttname"><a href="class_c_tcp_server.html#a5e63118cf3e1b653812c6a0b26db979a">CTcpServer::WaitServerStop</a></div><div class="ttdeci">virtual void WaitServerStop()</div><div class="ttdoc">通知服务停止并等待</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_server_8cpp_source.html#l00121">TcpServer.cpp:121</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_a16425af907976af975345df6666c6b16"><div class="ttname"><a href="class_c_tcp_io_server.html#a16425af907976af975345df6666c6b16">CTcpIoServer::_service</a></div><div class="ttdeci">SharedPtr&lt; CTcpServer &gt; _service</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00146">TcpIoServer.h:146</a></div></div>
<div class="ttc" id="aclass_c_tcp_server_html_a34e5408e88e0161b6a08807266302ce9"><div class="ttname"><a href="class_c_tcp_server.html#a34e5408e88e0161b6a08807266302ce9">CTcpServer::IsStop</a></div><div class="ttdeci">virtual bool IsStop() const</div><div class="ttdoc">服务是否停止</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_server_8cpp_source.html#l00116">TcpServer.cpp:116</a></div></div>
<div class="ttc" id="aclass_post_handle_null_html"><div class="ttname"><a href="class_post_handle_null.html">PostHandleNull</a></div><div class="ttdef"><b>Definition:</b> <a href="_sock_tools_8h_source.html#l00255">SockTools.h:255</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_ad0e29bdab15b44c4ea6c9a246424865f"><div class="ttname"><a href="class_c_tcp_io_server.html#ad0e29bdab15b44c4ea6c9a246424865f">CTcpIoServer::GetTcpServicePtr</a></div><div class="ttdeci">CBasicService * GetTcpServicePtr()</div><div class="ttdoc">获取底层服务类</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00142">TcpIoServer.h:142</a></div></div>
<div class="ttc" id="aclass_c_basic_service_html"><div class="ttname"><a href="class_c_basic_service.html">CBasicService</a></div><div class="ttdoc">服务类 基类</div><div class="ttdef"><b>Definition:</b> <a href="_service_base_8h_source.html#l00015">ServiceBase.h:15</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_socket_html"><div class="ttname"><a href="class_c_tcp_io_socket.html">CTcpIoSocket</a></div><div class="ttdoc">用于tcp进行io投递的套接字类</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_socket_8h_source.html#l00017">TcpIoSocket.h:17</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_a3d57fa6836c9b6a1bbb87f48234e0dba"><div class="ttname"><a href="class_c_tcp_io_server.html#a3d57fa6836c9b6a1bbb87f48234e0dba">CTcpIoServer::AsyncSend</a></div><div class="ttdeci">void AsyncSend(CTcpIoSocket &amp;sock, const CStreamIteator &amp;buff, const Func &amp;func, void *invoker)</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00086">TcpIoServer.h:86</a></div></div>
<div class="ttc" id="aclass_c_tcp_io_server_html_addea632498b2adb1a24972ffc6c25231"><div class="ttname"><a href="class_c_tcp_io_server.html#addea632498b2adb1a24972ffc6c25231">CTcpIoServer::NotifyStop</a></div><div class="ttdeci">void NotifyStop()</div><div class="ttdoc">通知服务停止</div><div class="ttdef"><b>Definition:</b> <a href="_tcp_io_server_8h_source.html#l00124">TcpIoServer.h:124</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
